<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解构嵌套对象</title>

    <script>
        // 解构嵌套对象
        let person = { friends: ["Alice", {job:"CEO", age:19}] };
        let {friends: [name, {age, gender}]} = person;
        console.log(name);// Alice
        console.log(age);// 19
        console.log(gender);// undefined
    </script>
</head>
<body>
    
</body>
</html>